package com.hqyj.springboot.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.persistence.*;

//Entity表示该实体类会映射为数据库的表。
@Entity
@Table(name="users")
@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
public class Users extends BaseEntity {
    //以下这两个是JPA的注解
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    //以下是mybatisplus的主键策略注解
    @TableId(type = IdType.AUTO)

    private Integer uid; //主键

    private String username; //用户名
    private String password; //密码

    @Column(length = 50)
    private String birthday; //出身日期

    @Column(length = 2)
    private String gender; //性别

    @Column(length = 50)
    private String address; //地址
}
